package com.itheima.controller;

import com.itheima.dto.CollectionDto;
import com.itheima.service.CollectionService;
import com.itheima.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :wujunjie
 * createTime :2023-01-03 15:50
 * description :
 */
@RestController
@RequestMapping("/collection_behavior")
public class CollectionController {

    @Autowired
    private CollectionService collectionService;

    @PostMapping
    public Result collection(@RequestBody CollectionDto dto) {
        Boolean collection = collectionService.collection(dto);
        if (collection){
            return Result.success();
        }
     return Result.error();
    }
}
